import { _decorator, log } from 'cc'
import { Role } from '../../Base/Role'
import { SMOKE_STATE, SmokeStateMachine } from './SmokeStateMachine'
const { ccclass, property } = _decorator

@ccclass('SmokeController')
export class SmokeController extends Role {
  x = 0
  y = 0
  _fsm: SmokeStateMachine = null
  init() {
    console.log('SmokeController init')
    //创建门精灵组件
    this.createRoleSprite()
    this._fsm = new SmokeStateMachine(this._animationComponent)
  }
  generateSmoke(state: SMOKE_STATE, x: number, y: number) {
    this.setPos(x, y)
    this._fsm.stateName = state
  }
}
